package com.pig.graduate.controller.material;


import com.pig.graduate.domain.material.MaterialDeliver;
import com.pig.graduate.domain.material.MaterialInventory;
import com.pig.graduate.domain.material.MaterialStorage;
import com.pig.graduate.result.MyResult;
import com.pig.graduate.service.material.MaterialDeliverService;
import com.pig.graduate.service.material.MaterialStorageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"出库"}, description = "出库")
@RestController
@RequestMapping("/material/deliver")
public class MaterialDeliverController {


    @Autowired
    private MaterialDeliverService materialDeliverService;

    @ApiOperation(value = "出库列表",notes = "出库列表")
    @PostMapping("/list")
    public MyResult deliverList(@RequestBody MaterialDeliver materialDeliver){
        return materialDeliverService.deliverList(materialDeliver);
    }

    @ApiOperation(value = "出库",notes = "出库")
    @PostMapping("/deliver")
    public MyResult deliverMaterial(@RequestBody MaterialDeliver materialDeliver){
        return materialDeliverService.deliverMaterial(materialDeliver);
    }

    @ApiOperation(value = "报废",notes = "报废")
    @GetMapping("/materialScrap")
    public MyResult materialScrap(@RequestParam("id") Long id){
        return materialDeliverService.materialScrap(id);
    }
}
